package com.petvc.tv

object ApiConfig {
    // 服务器基础URL
    const val BASE_URL = "http://"
//    const val BASE_URL = "http://"
    const val SOCKET_SERVER_URL = BASE_URL

    // API版本和前缀
    const val API_PREFIX = "/api"
    const val API_VERSION = "v1"
    
    // 完整的API基础URL
    val API_BASE_URL: String
        get() = "$BASE_URL$API_PREFIX/$API_VERSION"
    
    // 认证相关接口
    object Auth {
        val LOGIN: String get() = "$API_BASE_URL/login"
        val REGISTER: String get() = "$API_BASE_URL/register"
        val LOGOUT: String get() = "$API_BASE_URL/logout"
        val REFRESH: String get() = "$API_BASE_URL/refresh"
        val PROFILE: String get() = "$API_BASE_URL/profile"
        val VERIFY: String get() = "$API_BASE_URL/verify"
    }
    
    // 视频相关接口
    object Video {
        val LIST: String get() = "$API_BASE_URL/videos"
        val DETAIL: String get() = "$API_BASE_URL/videos/{id}"
        val SEARCH: String get() = "$API_BASE_URL/videos/search"
        val CATEGORIES: String get() = "$API_BASE_URL/videos/categories"
    }
    
    // 设备相关接口
    object Device {
        val LIST: String get() = "$API_BASE_URL/devices"
        val ADD: String get() = "$API_BASE_URL/devices"
        val DELETE: String get() = "$API_BASE_URL/devices/{id}"
        val HEARTBEAT: String get() = "$API_BASE_URL/devices/heartbeat"
    }
    
    // 消息相关接口
    object Message {
        val LIST: String get() = "$API_BASE_URL/messages"
        val SEND: String get() = "$API_BASE_URL/messages"
        val DELETE: String get() = "$API_BASE_URL/messages/{id}"
    }
    
    // 实时控制接口
    object RealtimeControl {
        val CONTROL: String get() = "$API_BASE_URL/realtime/control"
        val STATUS: String get() = "$API_BASE_URL/realtime/status"
    }
    
    // TV控制接口
    object TVControl {
        val POWER: String get() = "$API_BASE_URL/tv/power"
        val VOLUME: String get() = "$API_BASE_URL/tv/volume"
        val CHANNEL: String get() = "$API_BASE_URL/tv/channel"
        val INPUT: String get() = "$API_BASE_URL/tv/input"
    }
    
    // 监控相关接口
    object Monitor {
        val STATISTICS: String get() = "$API_BASE_URL/monitor/statistics"
        val CONNECTIONS: String get() = "$API_BASE_URL/monitor/connections"
        val DEVICES: String get() = "$API_BASE_URL/monitor/devices"
    }
    
    // HTTP请求配置
    object HttpConfig {
        const val TIMEOUT_SECONDS = 30L
        const val CONNECT_TIMEOUT_SECONDS = 10L
        const val READ_TIMEOUT_SECONDS = 30L
        const val WRITE_TIMEOUT_SECONDS = 30L
    }
    
    // 响应状态码
    object StatusCode {
        const val SUCCESS = 200
        const val CREATED = 201
        const val BAD_REQUEST = 400
        const val UNAUTHORIZED = 401
        const val FORBIDDEN = 403
        const val NOT_FOUND = 404
        const val CONFLICT = 409
        const val INTERNAL_SERVER_ERROR = 500
    }
} 